import Layout from '@/layout'
import RouteButtonsBuilder from '@/framework/infra/router/RouterButtonsBuilder'
import TableButtonType from "@/framework/constant/TableButtonType";

export default [
  {
    path: '/mms',
    component: Layout,
    meta: {title: '消息管理', icon: 'el-icon-message-solid'},
    children: [
      {
        path: 'notice',
        component: () => import('@/feature/mms/app/notice/index'),
        meta: {title: '消息管理', icon: 'el-icon-bell'},
        buttons: RouteButtonsBuilder.builder('mms:notice', '消息').r().addButtons([
          {handler: 'create', type: TableButtonType.TOOLBAR, label: '新建消息', icon: 'el-icon-plus'},
          {handler: 'remove', type: TableButtonType.ROW, label: '删除', buttonType: 'danger', icon: 'el-icon-delete'}
        ])
          .build()
      },
      {
        path: 'my-msg',
        component: () => import('@/feature/mms/app/notice/mymsg'),
        meta: {title: '我的消息', icon: 'el-icon-bell'},
        buttons: RouteButtonsBuilder.builder('mms:mine-msg', '消息').r()
          .addButton({
            handler: 'setRead',
            label: '标记已读',
            showFilter: v => v.readFlag === 0
          }).addButton({
            handler: 'setReadAll',
            label: '标记全部已读',
            type: TableButtonType.TOOLBAR
          })
          .build()
      }
      // #appendSpot# 生成工具用，不要删了
    ]
  }
]
